#include "widget.h"
#include "ui_widget.h"

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    timer=new QTimer(this);
    timer->start(1000);
    connect(timer,&QTimer::timeout,this,[this]()
    {
        int value=ui->progressBar->value();
        if(value>=100)
        {
            timer->stop();
            return;
        }
        else ui->progressBar->setValue(value+1);
    });
}

Widget::~Widget()
{
    delete ui;
}

